﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using Castle.Windsor;
using Castle.MicroKernel.Registration;

namespace WindsorInitConfig
{
    [TestFixture]
    public class ListServiceOverrides {
        [Test]
        public void ttt()
        {
            var container = new WindsorContainer();
            container.Register(Component.For<IController>().ImplementedBy<Controller>().Named("a"));
            container.Register(Component.For<IController>().ImplementedBy<Controller>().Named("b"));
            container.Register(Component.For<MyComponent>().ServiceOverrides(new { controllers = new[] { "a", "b" } }));
            //container.Register(Component.For<MyComponent>());
            container.Resolve<MyComponent>();
        }

        public class MyComponent
        {
            public MyComponent(List<IController> controllers) { }
        }

        public interface IController { }
        public class Controller : IController { }
    }
}
